Skip to content

AssemblyProcessor refactor#3091

Merged
xen2 merged 13 commits intostride3d:masterfrom
xen2:assemblyprocessor_improvements
Mar 17, 2026
Merged

AssemblyProcessor refactor#3091
xen2 merged 13 commits intostride3d:masterfrom
xen2:assemblyprocessor_improvements

Conversation

@xen2
Copy link
Member

@xen2 xen2 commented Mar 16, 2026

PR Details

Following discussion on #1835 (comment) I took a quick pass on the assembly processor to make it more maintainable:

  • Separated serializer collection from generation: Clear two-phase pipeline in CecilSerializerContext — resolve types first, then generate code. Removed factory indirection (ICecilSerializerFactory, CecilSerializerDependency, etc.).
  • Introduced SerializerDescriptor and SerializerCodegenContext to replace scattered state and 12-parameter methods.
  • Extracted IL helpers from 150+ line methods (EmitFieldRegistration, EmitPropertyRegistration, EmitLoadMember, etc.) and added C# pseudocode comments to all IL codegen blocks.
  • Introduced ILBuilder: Fluent wrapper over Cecil IL emission with import helpers
  • Replaced IL-rewritten UpdateEngineHelper methods (ObjectToPtr, PtrToObject, Unbox) with System.Runtime.CompilerServices.Unsafe equivalents, then deleted them (zero callers).
  • Removed dead code, renamed ComplexSerializerIsGeneratedSerializer, added ResolveGenericsVisitor.ForGenericMapping to deduplicate generic parameter mapping.

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@xen2 xen2 changed the title AssemblyProcessor improvements AssemblyProcessor refactor Mar 16, 2026
@xen2 xen2 merged commit d6c133c into stride3d:master Mar 17, 2026
18 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant